/*
 * pixel.cpp
 *
 *  Created on: Feb 26, 2011
 *      Author: Mo
 */

#include "pixel.h"

void Pixel::setRow (int r)	{this->row = r;}
void Pixel::setCol (int c)	{this->col = c;}
void Pixel::setValue (int v){this->value = v;}
int Pixel::getRow (void)	{return this->row;}
int Pixel::getCol (void)	{return this->col;}
int Pixel::getValue (void)	{return this->value;}

void Pixel::setRowCol (int r, int c)
{
	this->row = r;
	this->col = c;
}

Pixel::Pixel (int r, int c)
{
	this->row = r;
	this->col = c;
}

Pixel::Pixel (int r, int c, int v)
{
	this->row = r;
	this->col = c;
	this->value = v;
}

Pixel::Pixel ()
{
	this->row = 0;
	this->col = 0;
	this->value = 0;
}

//Pixel::Pixel(Pixel& other)
//{
//	this->row = other.row;
//	this->col = other.col;
//	this->value = other.value;
//}

Pixel::~Pixel()
{
	this->row = 0;
	this->col = 0;
	this->value = 0;
}

Pixel& Pixel::operator= (const Pixel & p)
{
	if (&p == this)
		return *this;
	this->col = p.col;
	this->row = p.row;
	this->value = p.value;

	return *this;
}

bool Pixel::hasSameCoordinate(int row, int col)
{
	return (this->row == row && this->col == col);
}

bool Pixel::hasSameCoordinate(const Pixel p)
{
	return (this->row == p.row && this->col == p.col);
}
